interface Pointlike {
    x: number
    y: number
}

interface Named {
    name: string
}

function logPoint(point: Pointlike) {
    console.log(`x = ${point.x}, y = ${point.y}`)
}

function logName(x: Named) {
    console.log(`hello, ${x.name}`)
}

const obj = {
    x: 10,
    y: 20,
    name: "diaomao",
}
logPoint(obj)
logName(obj)